import { Meta } from '@storybook/blocks';

import * as SimpleDialogStories from '../stories/SimpleDialog.stories';

<Meta of={SimpleDialogStories} />

# SimpleDialog

A simple material design dialog.

## Example

```dart liveslice=SimpleDialog
Future<void> _askedToLead() async {
  switch (await showDialog<Department>(
    context: context,
    builder: (BuildContext context) {
      return SimpleDialog(
        title: const Text('Select assignment'),
        children: <Widget>[
          SimpleDialogOption(
            onPressed: () { Navigator.pop(context, Department.treasury); },
            child: const Text('Treasury department'),
          ),
          SimpleDialogOption(
            onPressed: () { Navigator.pop(context, Department.state); },
            child: const Text('State department'),
          ),
        ],
      );
    }
  )) {
    case Department.treasury:
      // Let's go.
      // ...
    break;
    case Department.state:
      // ...
    break;
  }
}
```

## Related Links

- https://api.flutter.dev/flutter/material/SimpleDialog-class.html
